Optimal. Leaf size=138 \[ \frac{a \left (a^2-6 b^2\right ) \tanh ^{-1}(\cos (c+d x))}{2 d}-\frac{1}{2} b x \left (6 a^2-b^2\right )+\frac{15 a b^2 \cos (c+d x)}{2 d}-\frac{3 b \cot (c+d x) (a+b \sin (c+d x))^2}{2 d}-\frac{\cot (c+d x) \csc (c+d x) (a+b \sin (c+d x))^3}{2 d}+\frac{5 b^3 \sin (c+d x) \cos (c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.465199, antiderivative size = 138, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 7, integrand size = 27, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.259, Rules used = {2889, 3048, 3047, 3033, 3023, 2735, 3770} \[ \frac{a \left (a^2-6 b^2\right ) \tanh ^{-1}(\cos (c+d x))}{2 d}-\frac{1}{2} b x \left (6 a^2-b^2\right )+\frac{15 a b^2 \cos (c+d x)}{2 d}-\frac{3 b \cot (c+d x) (a+b \sin (c+d x))^2}{2 d}-\frac{\cot (c+d x) \csc (c+d x) (a+b \sin (c+d x))^3}{2 d}+\frac{5 b^3 \sin (c+d x) \cos (c+d x)}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2889
Rule 3048
Rule 3047
Rule 3033
Rule 3023
Rule 2735
Rule 3770
Rubi steps
\begin{align*} \int \cot ^2(c+d x) \csc (c+d x) (a+b \sin (c+d x))^3 \, dx &=\int \csc ^3(c+d x) (a+b \sin (c+d x))^3 \left (1-\sin ^2(c+d x)\right ) \, dx\\ &=-\frac{\cot (c+d x) \csc (c+d x) (a+b \sin (c+d x))^3}{2 d}+\frac{1}{2} \int \csc ^2(c+d x) (a+b \sin (c+d x))^2 \left (3 b-a \sin (c+d x)-4 b \sin ^2(c+d x)\right ) \, dx\\ &=-\frac{3 b \cot (c+d x) (a+b \sin (c+d x))^2}{2 d}-\frac{\cot (c+d x) \csc (c+d x) (a+b \sin (c+d x))^3}{2 d}+\frac{1}{2} \int \csc (c+d x) (a+b \sin (c+d x)) \left (-a^2+6 b^2-5 a b \sin (c+d x)-10 b^2 \sin ^2(c+d x)\right ) \, dx\\ &=\frac{5 b^3 \cos (c+d x) \sin (c+d x)}{2 d}-\frac{3 b \cot (c+d x) (a+b \sin (c+d x))^2}{2 d}-\frac{\cot (c+d x) \csc (c+d x) (a+b \sin (c+d x))^3}{2 d}+\frac{1}{4} \int \csc (c+d x) \left (-2 a \left (a^2-6 b^2\right )-2 b \left (6 a^2-b^2\right ) \sin (c+d x)-30 a b^2 \sin ^2(c+d x)\right ) \, dx\\ &=\frac{15 a b^2 \cos (c+d x)}{2 d}+\frac{5 b^3 \cos (c+d x) \sin (c+d x)}{2 d}-\frac{3 b \cot (c+d x) (a+b \sin (c+d x))^2}{2 d}-\frac{\cot (c+d x) \csc (c+d x) (a+b \sin (c+d x))^3}{2 d}+\frac{1}{4} \int \csc (c+d x) \left (-2 a \left (a^2-6 b^2\right )-2 b \left (6 a^2-b^2\right ) \sin (c+d x)\right ) \, dx\\ &=-\frac{1}{2} b \left (6 a^2-b^2\right ) x+\frac{15 a b^2 \cos (c+d x)}{2 d}+\frac{5 b^3 \cos (c+d x) \sin (c+d x)}{2 d}-\frac{3 b \cot (c+d x) (a+b \sin (c+d x))^2}{2 d}-\frac{\cot (c+d x) \csc (c+d x) (a+b \sin (c+d x))^3}{2 d}-\frac{1}{2} \left (a \left (a^2-6 b^2\right )\right ) \int \csc (c+d x) \, dx\\ &=-\frac{1}{2} b \left (6 a^2-b^2\right ) x+\frac{a \left (a^2-6 b^2\right ) \tanh ^{-1}(\cos (c+d x))}{2 d}+\frac{15 a b^2 \cos (c+d x)}{2 d}+\frac{5 b^3 \cos (c+d x) \sin (c+d x)}{2 d}-\frac{3 b \cot (c+d x) (a+b \sin (c+d x))^2}{2 d}-\frac{\cot (c+d x) \csc (c+d x) (a+b \sin (c+d x))^3}{2 d}\\ \end{align*}
Mathematica [A] time = 1.33709, size = 192, normalized size = 1.39 \[ \frac{12 a^2 b \tan \left (\frac{1}{2} (c+d x)\right )-12 a^2 b \cot \left (\frac{1}{2} (c+d x)\right )-24 a^2 b c-24 a^2 b d x+a^3 \left (-\csc ^2\left (\frac{1}{2} (c+d x)\right )\right )+a^3 \sec ^2\left (\frac{1}{2} (c+d x)\right )-4 a^3 \log \left (\sin \left (\frac{1}{2} (c+d x)\right )\right )+4 a^3 \log \left (\cos \left (\frac{1}{2} (c+d x)\right )\right )+24 a b^2 \cos (c+d x)+24 a b^2 \log \left (\sin \left (\frac{1}{2} (c+d x)\right )\right )-24 a b^2 \log \left (\cos \left (\frac{1}{2} (c+d x)\right )\right )+2 b^3 \sin (2 (c+d x))+4 b^3 c+4 b^3 d x}{8 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.098, size = 171, normalized size = 1.2 \begin{align*} -{\frac{{a}^{3} \left ( \cos \left ( dx+c \right ) \right ) ^{3}}{2\,d \left ( \sin \left ( dx+c \right ) \right ) ^{2}}}-{\frac{{a}^{3}\cos \left ( dx+c \right ) }{2\,d}}-{\frac{{a}^{3}\ln \left ( \csc \left ( dx+c \right ) -\cot \left ( dx+c \right ) \right ) }{2\,d}}-3\,{a}^{2}bx-3\,{\frac{{a}^{2}b\cot \left ( dx+c \right ) }{d}}-3\,{\frac{{a}^{2}bc}{d}}+3\,{\frac{a{b}^{2}\cos \left ( dx+c \right ) }{d}}+3\,{\frac{a{b}^{2}\ln \left ( \csc \left ( dx+c \right ) -\cot \left ( dx+c \right ) \right ) }{d}}+{\frac{{b}^{3}\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) }{2\,d}}+{\frac{{b}^{3}x}{2}}+{\frac{{b}^{3}c}{2\,d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.63022, size = 173, normalized size = 1.25 \begin{align*} -\frac{12 \,{\left (d x + c + \frac{1}{\tan \left (d x + c\right )}\right )} a^{2} b -{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} b^{3} - a^{3}{\left (\frac{2 \, \cos \left (d x + c\right )}{\cos \left (d x + c\right )^{2} - 1} + \log \left (\cos \left (d x + c\right ) + 1\right ) - \log \left (\cos \left (d x + c\right ) - 1\right )\right )} - 6 \, a b^{2}{\left (2 \, \cos \left (d x + c\right ) - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )}}{4 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.69171, size = 510, normalized size = 3.7 \begin{align*} \frac{12 \, a b^{2} \cos \left (d x + c\right )^{3} - 2 \,{\left (6 \, a^{2} b - b^{3}\right )} d x \cos \left (d x + c\right )^{2} + 2 \,{\left (6 \, a^{2} b - b^{3}\right )} d x + 2 \,{\left (a^{3} - 6 \, a b^{2}\right )} \cos \left (d x + c\right ) -{\left (a^{3} - 6 \, a b^{2} -{\left (a^{3} - 6 \, a b^{2}\right )} \cos \left (d x + c\right )^{2}\right )} \log \left (\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) +{\left (a^{3} - 6 \, a b^{2} -{\left (a^{3} - 6 \, a b^{2}\right )} \cos \left (d x + c\right )^{2}\right )} \log \left (-\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) + 2 \,{\left (b^{3} \cos \left (d x + c\right )^{3} +{\left (6 \, a^{2} b - b^{3}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{4 \,{\left (d \cos \left (d x + c\right )^{2} - d\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.27662, size = 367, normalized size = 2.66 \begin{align*} \frac{a^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 12 \, a^{2} b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 4 \,{\left (6 \, a^{2} b - b^{3}\right )}{\left (d x + c\right )} - 4 \,{\left (a^{3} - 6 \, a b^{2}\right )} \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) \right |}\right ) + \frac{2 \, a^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{6} - 12 \, a b^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{6} - 12 \, a^{2} b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{5} - 8 \, b^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{5} + 3 \, a^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{4} + 24 \, a b^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{4} - 24 \, a^{2} b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 8 \, b^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 36 \, a b^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 12 \, a^{2} b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - a^{3}}{{\left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )\right )}^{2}}}{8 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]